#ifndef DEBUG_H_
#define DEBUG_H_
/*
 * this file declares all you need to track on stderr
 * what's being done
 *
 * there are multiple verbosity levels for each component
 */

#define DEBUG_TEMPLATE(ns,...) fprintf(stderr,"%s(%d):\t",(ns),__LINE__); fprintf(stderr,__VA_ARGS__); fprintf(stderr,"\033[00m\n")
#define DEBUG_SCANNER 1
#define DEBUG_PARSER 1

#if DEBUG_SCANNER
# if 1
#  define DEBUG_SCANNER1(...) DEBUG_TEMPLATE("\033[22;31mscanner",__VA_ARGS__)
# else
#  define DEBUG_SCANNER1(...)
# endif

# if 1
#  define DEBUG_SCANNER2(...) DEBUG_TEMPLATE("\033[01;31mscanner",__VA_ARGS__)
# else
#  define DEBUG_SCANNER2(...)
# endif

#else
# define DEBUG_SCANNER1(...)
# define DEBUG_SCANNER2(...)
#endif



#if DEBUG_PARSER
# if 1
#  define DEBUG_PARSER1(...) DEBUG_TEMPLATE("\033[01;34mparser",__VA_ARGS__)
# else
#  define DEBUG_PARSER1(...)
# endif

# if 1
#  define DEBUG_PARSER2(...) DEBUG_TEMPLATE("\033[01;35mparser",__VA_ARGS__)
# else
#  define DEBUG_PARSER2(...)
# endif

# if 1
#  define DEBUG_PARSER3(...) DEBUG_TEMPLATE("\033[01;36mparser",__VA_ARGS__)
# else
#  define DEBUG_PARSER3(...)
# endif

#else
# define DEBUG_PARSER1(...)
# define DEBUG_PARSER2(...)
# define DEBUG_PARSER3(...)
#endif



#endif
